import request from '@/utils/request'
//主表查询
export function fetchList(params) {
  return request({
    url: '/dict/list',
    method: 'get',
    params: params
  })
}
//添加
export function createDict(entity) {
  return request({
    url: '/dict/add',
    method: 'post',
    data: entity
  })
}

//修改
export function updateDict(data) {
  return request({
    url: '/dict/update',
    method: 'post',
    data: data
  })
}

export function selectByGroupId(id) {
  return request({
    url: '/dict/getById/' + id,
    method: 'get',
  })
}
//单删
export function deleteDict(id) {
  return request({
    // url:'/dict/delete/'+id,
    url: '/dict/delete/?id=' + id,
    method: 'get',
  })
}
//批量删除GET
export function deleteDictBatch(ids) {
  return request({
    url: '/dict/deleteBatch',
    method: 'get',
    params: ids
  })
}




//子表查询
export function getAllId(param) {
  return request({
    url: '/sysDetail/getAllId',
    method: 'get',
    params: param
  })
}


//子表单删
export function deleteDetail(id) {
  return request({
    url: '/sysDetail/delete/?id=' + id,
    method: 'get',
  })
}

//子表添加
export function addDict(entity) {
  return request({
    url: '/sysDetail/add',
    method: 'post',
    data: entity
  })
}

//子表修改
export function updateDetail(data) {
  return request({
    url: '/sysDetail/update',
    method: 'post',
    data: data
  })
}
